/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dataanalysis.gui.methoddlg;

import dataanalysis.main.MainView;
import java.awt.Frame;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import weka.classifiers.Classifier;
import weka.gui.explorer.ExplorerDefaults;

/**
 *
 * @author Administrator
 */
public class ClsMethodDlg extends BaseMethodDlg {

    public ClsMethodDlg(Frame parent, boolean modal, MainView manager) {
        super(parent, modal, manager);
    }

    @Override
    public void setEditorValueDoc() {
        m_manager.setClassifierValueDoc((Classifier) m_backup);
    }

    @Override
    protected void editorChangeAction() {
        updateUIState();
    }

    @Override
    protected void initObjEditor() {
        Class type = weka.classifiers.Classifier.class;
        Object initial = ExplorerDefaults.getClassifier();
        m_objEditor = new MyObjectEditor(type, initial);
        m_manager.setClassifierValueDoc((Classifier) initial);
        m_objEditor.addPropertyChangeListener((PropertyChangeListener) new PropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent e) {
                editorChangeAction();
            }
        });
    }
}
